package com.water.quality.testing.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.water.quality.testing.dao.ObservationPoint;
import com.water.quality.testing.mapper.ObservationPointMapper;
import com.water.quality.testing.service.ObservationPointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ObservationPointServiceImpl extends ServiceImpl<ObservationPointMapper, ObservationPoint> implements ObservationPointService {
    /**
     * 注入观测点的 mapper
     */
    @Autowired
    private ObservationPointMapper observationPointMapper;

    /**
     * 获取所有的观测点
     */
    public List<ObservationPoint> getAllObservationPoints() {
        return observationPointMapper.selectList(null);
    }

    /**
     * 保存观测点（此次开发并未使用该方法，如果后续想实现在页面上手动添加观测点，可使用此方法）
     * @param point  观测点
     */
    public void saveObservationPoint(ObservationPoint point) {
        observationPointMapper.insert(point);
    }
}
